package com.jswdwsx.esign.protocol

import com.jswdwsx.esign.protocol.response.TokenResp
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.*


interface EsignOtherApi {

    /**
     * 获取token
     * @param appId
     * @param secret
     * @param grantType
     * @return
     */
    @GET("v1/oauth2/access_token")
    fun getToken(
        @Query("appId") appId: String,
        @Query("secret") secret: String,
        @Query("grantType") grantType: String
    ): EsignResp<TokenResp>


    /**
     * 向E签宝指定地址上传文件已完成文件模板的创建
     */
    @PUT
    fun uploadFile(
        @Url uploadUrl: String,
        @Header("Content-Type") contentType: String,
        @Header("Content-MD5") contentMd5: String,
        @Header("Content-Length") contentLength: String,
        @Body file: RequestBody
    ): Call<Any>
}